Get Unread Notification Count
The getUnreadNotificationCount() function is used to fetch the count of unread notifications. It takes no parameters and returns a GetUnreadNotificationCountResponse as a Future.
Steps to Get Unread Notification Count
Call the
getUnreadNotificationCount()function using the instance of theLMFeedClientclass.Use the response as per your requirement.
// Get the response from calling the function
final GetUnreadNotificationCountResponse unreadNotificationCountResponse = await lmFeedClient.getUnreadNotificationCount();
// Process the response, as per requirement
if(unreadNotificationCountResponse.success){
// your function to handle successful retrieval of unread notification count
handleUnreadNotificationCountSuccess(unreadNotificationCountResponse.count);
}else{
// your function to handle error message
handleUnreadNotificationCountError(unreadNotificationCountResponse.errorMessage);
}
Models
GetUnreadNotificationCountResponse
List of parameters for the GetUnreadNotificationCountResponse class
| Variable | Type | Description | Optional |
|---|---|---|---|
| success | bool | API success status | |
| errorMessage | String | Error message in case of failure | ✔ |
| count | int | Count of unread notifications | ✔ |